package com.lly;

import com.lly.netcross.client.TcpClient;

import java.net.InetSocketAddress;
import java.net.Socket;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args ){
//        test();
        TcpClient client = new TcpClient();
        client.start();
    }

    private static void test(){
        String serverIp = "127.0.0.1";
        int serverPort = 8080;
        try {
            Socket socket = new Socket();
            socket.connect(new InetSocketAddress(serverIp,serverPort));
            int localPort = socket.getLocalPort();
            String localIp = socket.getLocalAddress().getHostAddress();
            String localIp1 = socket.getLocalAddress().getCanonicalHostName();
            String localIp2 = socket.getLocalAddress().getHostName();
            String message = socket.getLocalSocketAddress().toString();
            boolean reu = socket.getReuseAddress();
            System.out.println("ip:"+localIp);
            System.out.println("ip1:"+localIp1);
            System.out.println("ip2:"+localIp2);
            System.out.println("port:"+localPort);
            System.out.println("message :"+message);
            System.out.println("reu :"+reu);
        }catch (Exception e){

        }

    }
}
